﻿<%@ Page Language="C#" MasterPageFile="~/WebAdminWithConfirmation.master" AutoEventWireup="true"
    CodeBehind="ManageAppSettings.aspx.cs" Inherits="Salient.Web.Administration.AppConfig.ManageAppSettings" %>

<%-- Main Content --%>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="titleBar">
    <asp:Literal runat="server" ID="MainTitle" Text="<%$ Resources:Title %>" />
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="content">
    <table height="100%" width="100%" cellspacing="0" cellpadding="0">
        <tr>
            <td>
                <table height="100%" width="100%" cellspacing="0" cellpadding="1">
                    <tr class="bodyText" valign="top" height="1%">
                        <td>
                            <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:Instructions %>" />
                        </td>
                    </tr>
                    <tr height="20">
                        <td />
                    </tr>
                    <tr height="1%">
                        <td>
                            <table height="100%" width="100%" cellspacing="0" cellpadding="0" rules="all" bordercolor="#CCDDEF"
                                border="1" style="border-color: #CCDDEF; border-style: None; border-collapse: collapse;">
                                <tr valign="top">
                                    <td class="lbBorders">
                                        <asp:GridView runat="server" ID="AppSettingGridView" Width="100%" CellSpacing="0"
                                            CellPadding="5" border="0" AutoGenerateColumns="false" OnRowDeleting="AppSettingGridView_Delete"
                                            OnRowEditing="AppSettingGridView_Edit" AllowPaging="true" PageSize="7" OnPageIndexChanging="AppSettingGridView_PageIndexChanged"
                                            UseAccessibleHeader="true">
                                            <RowStyle CssClass="gridRowStyle" />
                                            <AlternatingRowStyle CssClass="gridAlternatingRowStyle" />
                                            <PagerSettings Mode="Numeric" Position="Bottom" />
                                            <PagerStyle CssClass="gridPagerStyle" />
                                            <HeaderStyle CssClass="callOutStyle" Font-Bold="true" />
                                            <Columns>
                                                <asp:TemplateField ItemStyle-Width="15%" HeaderText="<%$ Resources:SourceHeader %>">
                                                    <ItemTemplate>
                                                        <%# GetLocationTypeText((LocationType) DataBinder.Eval(Container.DataItem, "LocationType"))%>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField HeaderText="<%$ Resources:NameHeader %>" DataField="Name" ItemStyle-Width="20%" />
                                                <asp:BoundField HeaderText="<%$ Resources:ValueHeader %>" DataField="Value" ItemStyle-Width="20%" />
                                                <asp:TemplateField ItemStyle-Width="15%">
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Edit" ForeColor="blue"
                                                            Text='<%# (((LocationType) DataBinder.Eval(Container.DataItem, "LocationType")) == LocationType.Inherited) ? (string)GetLocalResourceObject("OverrideLinkText") : (string)GetLocalResourceObject("EditLinkText") %>'
                                                            ToolTip='<%# (((LocationType) DataBinder.Eval(Container.DataItem, "LocationType")) == LocationType.Inherited) ? GetToolTip("OverrideLinkToolTip",DataBinder.Eval(Container.DataItem, "Name").ToString()) : GetToolTip("EditLinkToolTip",DataBinder.Eval(Container.DataItem, "Name").ToString()) %>' />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Delete" ForeColor="blue"
                                                            Text="<%$ Resources:DeleteLinkText %>" ToolTip='<%# GetToolTip("DeleteLinkToolTip",DataBinder.Eval(Container.DataItem, "Name").ToString()) %>'
                                                            Enabled='<%# (((LocationType) DataBinder.Eval(Container.DataItem, "LocationType")) == LocationType.Inherited) ? false : true %>' />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                        </asp:GridView>
                                    </td>
                                </tr>
                                <tr class="gridPagerStyle" style="padding-left: 5;">
                                    <td>
                                        <asp:Label runat="server" ID="NumOfAppSettingsLabel" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr class="bodyText" valign="top">
                        <td>
                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="CreateAppSetting.aspx"
                                Text="<%$ Resources:CreateAppSettingLinkText %>" />
                            <td>
                    </tr>
                </table>
            </td>
            <td width="100" />
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="buttons">
    <asp:Button ValidationGroup="none" Text="<%$ Resources:GlobalResources,BackButtonLabel %>"
        ID="BackButton" OnClick="ReturnToPreviousPage" runat="server" />
</asp:Content>
<%-- Confirmation Dialog --%>
<asp:Content ID="Content4" runat="server" ContentPlaceHolderID="dialogTitle">
    <asp:Literal ID="Literal2" runat="server" Text="<%$ Resources:DeleteAppSettingTitle %>" />
</asp:Content>
<asp:Content ID="Content5" runat="server" ContentPlaceHolderID="dialogContent">
    <asp:HiddenField runat="server" ID="Name" />
    <table cellspacing="4" cellpadding="4">
        <tr class="bodyText">
            <td>
                <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/alert_lrg.gif" />
            </td>
            <td>
                <asp:Literal runat="server" ID="DeleteName" />
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content6" runat="server" ContentPlaceHolderID="dialogBottomLeftButton">
    <asp:Button ID="Button1" runat="server" OnClick="Yes_Click" Text="<%$ Resources:GlobalResources,YesButtonLabel %>"
        Width="100" />
</asp:Content>
<asp:Content ID="Content7" runat="server" ContentPlaceHolderID="dialogBottomRightButton">
    <asp:Button ID="Button2" runat="server" OnClick="No_Click" Text="<%$ Resources:GlobalResources,NoButtonLabel %>"
        Width="75" />
</asp:Content>
